import { configInterface } from '@/interface/configInterface';

const configPord: configInterface = {
  noAuthUrls: ['/login/admin', 'login/web', '/favicom.ico'],
  corsOptions: {
    origin: '*',
    methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
    preflightContinue: false,
    optionsSuccessStatus: 204, // some legacy browsers (IE11, various SmartTVs) choke on 204
  },
  rate_limit: {
    windowMs: 15 * 60 * 1000, // 15 minutes
    max: 100, // limit each IP to 100 requests per windowMs},
  },
  jwt: {
    secret: 'angjing213',
    expire: 60 * 60,
    alg: 'HS256',
    issuer: 'wangjing',
  },
  port: 3000,
  loggerLevel: ['error'],
  globalPrefix: 'v1/api',
  noAuthURL: ['/favicom.ico'],
  page: {
    pageSize: 1,
    pageNumber: 10,
  },

  fileConf: {
    size: 1024 * 1024 * 10,
    allowMintType: [
      'text/plan',
      'image/jpeg',
      'image/png',
      'image/jpg',
      'image/gif',
      'video/mp4',
    ],
  },

  typeOrm: {
    type: 'mysql',
    host: 'localhost',
    port: 3306,
    username: 'root',
    password: 'wangjing123',
    database: 'nestjs',
    synchronize: false, // 生产环境关闭
    autoLoadEntities: true,
    // logging: 'all',  // 生产环境关闭
  },
  Qiniu: {
    accessKey: 'YtrfQssYto5jFTiLvrhr4hUlQ4mB6gcdFzJSk8j-',
    secretKey: 'sTntqgpEg6CbGm4wmA-JDFl2WRSPoNlDyl24RsQB',
    bucket: 'nestjs18381532620',
    url: 'http://pic2.wineforyou.cn/',
  },
};

export { configPord };
